# +--------------------------
# | User: zq                -
# | Version: python3.7      -
# | Time: 2020-03-12 15:45                
# +--------------------------
from queue import Queue
import queue

if __name__ == "__main__":
    message_queue = Queue(maxsize=2)  # 最多放2个值
    # 向队列中放数据,可以放任何类或者对象, timeout
    message_queue.put("bobby")
    message_queue.put("bobby2")
    message = message_queue.get()
    print(message)  #输出 bobby

    message = message_queue.get()
    print(message)  # 输出 bobby2
